<cfcomponent name="ticketServiceBeforeAdvice" extends="coldspring.aop.BeforeAdvice">

  <!--- setters for dependencies --->
  <cffunction name="setTicketService" returntype="void" access="public" output="false" hint="Dependency: security service">
    <cfargument name="ticketService" type="any" _type="actionpacks.logger.service.TicketService" required="true"/>
    <cfset variables.m_ticketService = arguments.TicketService />
  </cffunction>

  <cffunction name="getTicketService" returntype="any" _returntype="actionpacks.logger.service.TicketService" access="public" output="false" hint="Dependency: security service">
    <cfreturn variables.m_ticketService />
  </cffunction>

  <!--- before() is called by the aop framework before method invocation --->
  <cffunction name="before" access="public" returntype="any">
    <cfargument name="method" type="coldspring.aop.Method" required="true" />
    <cfargument name="args" type="struct" required="true" />
    <cfargument name="target" type="any" required="true" />

    <cfset var arg = '' />
    <cfset var argString = '' />
    <cfset var objName = getMetadata(arguments.target).name />
    <cfloop collection="#args#" item="arg">
      <cfif isSimpleValue(args[arg])>
        <cfif len(argString)>
          <cfset argString = argString & ', ' />
        </cfif>
        <cfset argString = argString & arg & '=' & args[arg] >
      </cfif>
    </cfloop>
		<cfquery name="addLog" datasource="projects">
			INSERT INTO xmlrpclog (logMessage)
			VALUES ('[#objName#] #method.getMethodName()# (#argString#) called!')
		</cfquery>
  </cffunction>

</cfcomponent>